package candidate_43148;

import java.util.Scanner;


public class CandidateA_43148 extends Candidate_43148{
	private double mathematics, physics, chemistry;
	public CandidateA_43148(){
		mathematics=0;
		physics=0;
		chemistry=0;
	}
	public CandidateA_43148(double mathematics, double physics, double chemistry){
		this.mathematics=mathematics;
		this.physics=mathematics;
		this.chemistry=chemistry;
	}
	public void input() {
		super.input();
		Scanner kb = new Scanner(System.in);
		System.out.print("Enter mathematics :");
		mathematics = kb.nextDouble();
		System.out.print("Enter physics :");
		physics = kb.nextDouble();
		System.out.print("Enter chemistry :");
		chemistry = kb.nextDouble();
		System.out.println();
	}

	public double average() {
		return (mathematics + physics + chemistry) / 3;
	}

	

	public String toString() {
		return super.toString() + "mathematics:" + mathematics + "\n"
				+ "physics :" + physics + "\n" + "chemistry :" + chemistry
				+ "\n" + "Rank:" + rank() + "\nAverage:" + average();
	}

	public static void main(String args[]) {
		CandidateA_43148 h = new CandidateA_43148();
		h.input();
		System.out.print(h.toString());
	}

}
